<extend name="desktop_default/template/base_index" />
<block name="area_header">
    <link rel="stylesheet" href="__JS__/common/dropzone/dropzone.min.css">
    <script type="text/javascript" src="__JS__/common/dropzone/dropzone.min.js"></script>
    <link rel="stylesheet" href="__CSS__/yuerjing/style.css">
</block>

<block name="area_top">
    <include file="desktop_default/template/user_bar" />
    <include file="desktop_default/template/shcart_bar" />
    <include file="desktop_default/template/nav_bar" />
</block>

<block name="area_content">
    <div class="yuerjing main2-content">
        <div class="top-nav">
            <div class="btn-group">
                <a class="btn-nav" href="{:U('mengwu/yuerjing/share')}">妈妈分享</a>
                <a class="btn-nav selected" href="{:U('mengwu/yuerjing/question')}">妈妈提问</a>
                <a class="btn-publish" id="btn_publish"><img src=""></a>
            </div>
        </div>
        <div id="posts_list"></div>
    </div>
    <div class="bottom-line"></div>
</block>

<block name="area_footer">
    <include file="desktop_default/template/footer_ad" />
    <include file="desktop_default/template/footer_nav" />
    <include file="desktop_default/template/footer_bottom" />
</block>
<block name="area_js">
    <script type="text/javascript">
        var yej_hot_labels = {$hot_labels};
        var yej_post_type = 'question';
        var yej_post_type_desc = '妈妈提问';
    </script>
    <script type="text/javascript" src="__JS__/yuerjing/common.js"></script>
    <script type="text/javascript">
        var message = antd.message;
        message.config({
            top: 250
        });
        var yej_piclist = [];
        Dropzone.options.myDropzone = {
            paramName: "image", // The name that will be used to transfer the file
            maxFilesize: 0.5, // MB
            clickable: true,
            thumbnailWidth:'60',
            thumbnailHeight:'60',
            acceptedFiles: 'image/*',
            addRemoveLinks: true,
            dictRemoveFile: '删除',
            dictCancelUpload: '取消',
            dictDefaultMessage: '点击此处上传图片',
            dictResponseError: '图片上传失败!',
            init: function(){
                this.on("success", function(file,data){
                    if(data.status){
                        yej_piclist.push({
                            id  : data.id,
                            file: file
                        });
                        message.success(file.name+" 上传成功");
                    }else{
                        message.error(file.name+' 上传失败');
                    }
                });
                this.on('error',function(file){
                    message.error(file.name+' 上传失败');
                });
                this.on('removedfile',function(file){
                    yej_piclist = yej_piclist.filter(function(val){
                        if(file!==val.file)return true;
                    });
                });
            }
        };
    </script>
</block>